package domd2;

public class domd2 {
    public static void main(String[] args) throws CloneNotSupportedException {
        student stu1=new student("bob",18);
        student stu2=(student) stu1.clone();
    }
}
class student implements Cloneable{
    public String name;
    public int age;

    public student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
